package pl.us.ij.plugins.segmentation.infrastructure;

import ij.ImagePlus;
import ij.process.FloatProcessor;

/**
 * Created by IntelliJ IDEA.
 * User: pgajdzik
 * Date: Sep 15, 2010
 * Time: 11:49:02 PM
 * To change this template use File | Settings | File Templates.
 */
public abstract class ConvertStrategy {

    protected Integer[] channelMap;
    protected ImagePlus inputImage;
    protected CommandParams params;

    public ConvertStrategy(ImagePlus imp, CommandParams params) {
        this.inputImage = imp;
        this.params = params;

        this.channelMap = new Integer[1];
        this.channelMap[0] = 0;
    }

    public int getChannelCount() {
        return this.channelMap.length;
    }

    public abstract FloatProcessor getFloatProcessor( int channelNo );

    public void setFloatProcessor( int channelNo, FloatProcessor fp ) {
        this.inputImage.getProcessor().setPixels(this.channelMap[channelNo], fp);
    }
}
